David Bedingham notched up his maiden Test century as South Africa set New Zealand a target of 267 on the third day of the second and final Test at Hamilton's Seddon Park on Thursday.
Bedingham's 110, where majority of the runs came in a 98-run partnership with Keegan Petersen for the fifth wicket, pushed the inexperienced Proteas to 235 all out to give them a decent chance of levelling up the series at 1-1.
New Zealand openers scored 40 runs in the last hour, while chasing the target, but Devon Conway was dismissed lbw for 17 by spinner Dane Piedt in the last over of the day.
Conway's fellow opener Tom Latham will resume on 21 not out on Friday as the Black Caps look to score the remaining 227 runs they need to win a first series win over South Africa in 72 years.
Debutant paceman Will O'Rourke, the only New Zealander with less experience than most of the South Africans, bagged figures of five for 34 as the last six Proteas wickets fell for 33 runs but Bedingham stole the limelight during the day.
"Obviously really cool," said the 29-year-old. "I hope this innings can win us this test and draw the series. (Getting) Conway probably puts us even but I think (our bowlers) have it in them to get nine more wickets."
Bedingham made his Test debut in the two-match series against India over New Year but was one of only two players retained for New Zealand as Cricket South Africa preferred to keep their top players at home for the SA20 tournament.
After losing the first Test by 281 runs last week, South Africa impressed with the ball on Wednesday to take a first-innings lead of 31 runs but New Zealand pushed them on the backfoot after reducing the visitors to 88-3 at lunch.
All-rounder Rachin Ravindra made sure that Clyde Fortuin's poor series with the bat continued, while O'Rourke benefitted from some good bowling with the wickets of Raynard van Tonder and skipper Neil Brand (34).
Veteran South African-born seamer Neil Wagner finally got his chance with the ball after the interval and took a wicket with a trademark short ball which Zubayr Hamza (17) only succeeded in pulling to Will Young at deep square leg.
However, Bedingham and Petersen, built a partnership to put the Proteas back in charge, reaching tea at 186-4.
Petersen went back for 43 to a brilliant diving catch from Glenn Phillips off the bowling of Matt Henry but Bedingham could not stopped before a classy century, reaching the milestone with two runs from the 127th ball he faced.
Phillips then took control of proceedings, sending back Ruan de Swardt and Piedt cheaply with his right-arm spin and taking another good catch at gully to finally send Bedingham back and give O'Rourke his fourth victim.
O'Rourke sent the tail packing when he had Dane Paterson caught behind to secure his maiden Test five-wicket haul and improve his match tally to 9-93.
"Real special day," said O'Rourke. "I think we're feeling pretty confident. Obviously they batted well through the middle and we had to grind away but it fell pretty quickly in the end."